package com.helloworld.boot.controller;

import com.helloworld.boot.bean.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
  // 自动注入
  @Autowired
  Person person;

  @RequestMapping("/person")
  public Person person() {
    String userName = person.getUserName();
    System.out.println("userName = " + userName);
    return person;
  }
}
